package cn.digitalize.system.modular.user.controller;

import cn.digitalize.common.pojo.result.ResultData;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.map.MapUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author Created by ZhangCheng on 2023/06/05
 */
@RestController
public class SysUserCenterController {

    @GetMapping("/sys/userCenter/loginMenu")
    public ResultData<List<Tree<String>>> loginMenu() {
        List<TreeNode<String>> treeNodeList = CollectionUtil.newArrayList();
        Map<String, Object> extra1= MapUtil.newHashMap();
        extra1.put("path","/index");
        TreeNode t1=new TreeNode<>("1548901111999770526", null,
                "系统首页", "1").setExtra(extra1);
        treeNodeList.add(t1);
        return ResultData.query(TreeUtil.build(treeNodeList, "0"));
    }
}
